const cloud = require('wx-server-sdk')

cloud.init({
	env: cloud.DYNAMIC_CURRENT_ENV,
})

exports.main = async (event) => {
	try {
		const { id } = event
		const DB = cloud.database()

		const { data } = await DB.collection('gn_article').doc(id).get()

		return {
			code: 0,
			msg: '创建成功',
			data,
		}
	} catch (err) {
		throw err
	}
}
